package com.etone.smartAudit.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.etone.smartAudit.enums.StateType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author: sovy
 * @date: 2019-05-08 16:51:12
 * @description: 菜单
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "d_admin_menu")
public class AdminMenu implements Serializable {
    @TableId(type = IdType.AUTO, value = "intId")
    private Integer id;

    /**
     * 名称
     */
    @TableField(value = "vcTitle")
    private String title;

    /**
     * 路径
     */
    @TableField(value = "vcUrl")
    private String url;

    /**
     * 菜单图片
     */
    @TableField(value = "vcIcon")
    private String icon;

    /**
     * 排序，越小排到越前
     */
    @TableField(value = "intSort")
    private Integer sort;

    /**
     * 用户状态：ENABLE:有效,DISABLE:无效,DELETE:删除
     * {@link com.etone.smartAudit.enums.StateType}
     */
    @TableField(value = "vcState")
    private StateType state;

    @TableField(value = "intPId")
    private Integer pId;

    /**
     * 父级菜单
     */
    @TableField(exist = false)
    private AdminMenu p;

    /**
     * 管理员拥有角色
     */
    @TableField(exist = false)
    private List<AdminRole> adminRoles;


}